package cn.hhy.hrm.client;

import cn.hhy.hrm.domain.LoginUser;
import cn.hhy.hrm.dto.LoginUserDto;
import cn.hhy.hrm.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class AuthServiceClientFallbackFactory implements FallbackFactory<AuthServiceClient> {
    @Override
    public AuthServiceClient create(Throwable throwable) {
        return new AuthServiceClient() {
            @Override
            public AjaxResult add(LoginUserDto loginUserDto) {
                return AjaxResult.me().setSuccess(false).setMessage("啦啦啦啦啦德玛西亚");
            }

            @Override
            public AjaxResult webAdd(LoginUser loginUser) {
                return AjaxResult.me().setSuccess(false).setMessage("啦啦啦啦啦德玛西亚");
            }
        };
    }
}
